package guicommon.gui;

import guicommon.Header;
import guicommon.controls.Button;
import java.nio.CharBuffer;

public class ButtonMessage extends ControlMessage {

    public static final Integer ID = 2;

    public static final String TEXT = "text";

    ButtonMessage(Header header, CharBuffer buffer) {
        super(header, buffer);
    }

    public ButtonMessage() {
        super(ButtonMessage.class, ID);
    }

    public void SetText(String message) {
        SetBodyField(TEXT, message);
    }

    private String GetText() {
        return GetBodyField(TEXT);
    }

    @Override
    public Button ToControl() {
        Button result = new Button();
        SetCommonFields(result);
        result.SetText(GetText());
        return result;
    }

}
